Conversation
Signed-off-by: Renovate Bot <bot@renovateapp.com>
|
Hey! Changelogs info seems to be missing or might be in incorrect format. |
Branch automerge failureThis PR was configured for branch automerge, however this is not possible so it has been raised as a PR instead.
|
|
Thanks for opening an issue! Make sure you've followed CONTRIBUTING.md. |
|
Thanks for the PR! This section of the codebase is owner by https://github.com/AlexRogalskiy/ - if they write a comment saying "LGTM" then it will be merged. |
Hello from PR HelperIs your PR ready for review and processing? Mark the PR ready by including If you still have work to do, even after marking this ready. Put the PR on hold by including |
This PR contains the following updates:
^11.8.2->12.0.0-beta.2Release Notes
sindresorhus/got
v12.0.0-beta.2Compare Source
v12.0.0-beta.2introduces more stability fixes! Yay!Bug fixes
9ecc5eesearchParams(#1814)1018c20732e9bd2453e5e439fb82eda69ffusernameandpasswordencoding in URL (#1169 #1317)d65d0caImprovements
a5dd9aaDocumentation
3dc2ad96a44a81v12.0.0-beta.1Compare Source
We are pleased to announce Got v12.0.0 beta 1! 🎉
It's been a year and three months since Got 11 was released, and the latest Got version (v11.8.2) was released just in February ❄️
During that time, we have been working hard on squashing bugs and improving overall experience.
If you find Got useful, you might want to sponsor the Got maintainers.
This package is now pure ESM
Please read this. Also see sindresorhus/got#1789.
Required Node.js >=14
While working with streams, we encountered more Node.js bugs that needed workarounds.
In order to keep our code clean, we had to drop Node.js v12 as the code would get more messy.
We strongly recommend that you update Node.js to v14 LTS.
HTTP/2 support
Every Node.js release, the native
http2module gets more stable.Unfortunately there are still some issues on the Node.js side, so we decided to keep HTTP/2 disabled for now.
We may enable it by default in Got v13. It is still possible to turn it on via the
http2option.To run HTTP/2 requests, it is required to use Node.js v15.10 or above.
Bug fixes
Woah, we possibly couldn't make a release if we didn't fix some bugs!
49c16eecontent-lengthon ReadStream (#1510)472b8efff918fb1107cc6methodRewritingoption51d88a0urlnot being reused on retry in rare case (#1487)462bc63a59fac477df9c362305d706a2d3d1e1e506response.completewhen using cache9e15d88Cannot call enderror whenrequestreturns aWritable226cc393c23eea3c23eeagot.paginate does not call init hooks(#1574)3c23eeahttpsmodule (#1567)3c23eeaImprovements
contextoption mergeable (#1459)2b8ed1f6fc04a9e943672(blocked by No error is emitted on response destroy when socket is already destroyed nodejs/node#35923)267504611203704f21eb3retry.backoffLimitoption41c4136noiseretry optione83007783575d5fe723a0(thanks @Giotino)error.codef27e8d3options.urleven if some options are invalid8d6a6802db5ec5854430f3df52f3oncetypes for Stream API3c23eeaRetryErrorwhich always triggers a new retry when thrown3c23eeaerror.optionsis now enumerable3c23eeadefaults.handlersdon't need a default handler now3c23eeaLinkheader3c23eeaBreaking changes
Improved option normalization
Optionclass that is specifically designed to parse and validate Got options.It is made of setters and getters that provide fast normalization and more consistent behavior.
When passing an option does not exist, Got will throw an error. In order to retrieve the options before the error, use
error.options.inithook now accepts a second argument:self, which points to anOptionsinstance.In order to define your own options, you have to move them to
options.contextin aninithook or store them inoptions.contextdirectly.inithooks are ran only when passing an options object explicitly.options.merge()replacedgot.mergeOptionsandRequest.normalizeArgumentsThis fixes issues like #1450
Urlinstances are not supported anymore. You need to use WHATWG URL instead.dnsLookupIpVersionis now a number (4 or 6) or undefinedredirectUrlsandrequestUrlnow give URL instancesrequest.abortedtorequest.isAbortedReason: consistency with
options.isStream.lookupoption todnsLookupbeforeRetryhook now accepts only two arguments:errorandretryCountawait got('https://example.com', { hooks: { beforeRetry: [ - (options, error, retryCount) => { - console.log(options, error, retryCount); - } + (error, retryCount) => { + console.log(error.options, error, retryCount); + } ] } })The
optionsargument has been removed. If it was updated and the Stream API was used, the changes would not be reflected.To modify the
options, save the changes inside thecontext:beforeRedirecthook's first argument (options) is now a cloned instance of the Request options.This was done to make retrieving the original options possible:
plainResponse.request.options.await got('http://szmarczak.com', { hooks: { beforeRedirect: [ (options, response) => { - console.log(options === response.request.options); //=> true [invalid! our original options were overriden] + console.log(options === response.request.options); //=> false [we can access the original options now] } ] } })redirectevent now takes two arguments in this order:updatedOptionsandplainResponse.Reason: consistency with the
beforeRedirecthook.socketPathoption has been removed. Use theunix:protocol instead.retryWithMergedOptionsfunction in anafterResponsehook no longer returns aPromise.It now throws
RetryError, so this should this should be the last function being executed.This was done to allow
beforeRetryhooks getting called.options.agenttofalse.To do so, you need to define all the
options.agentproperties:http,httpsandhttp2.await got('https://example.com', { - agent: false + agent: { + http: false, + https: false, + http2: false + } })urloption when paginating, it now needs to be an absolute URL - theprefixUrloption is always reset from now on. The same when retrying in anafterResponsehook.There was confusion around the
prefixUrloption. It was counterintuitive if used with the Pagination API. For example, it worked fine if the server replied with a relative URL, but if it was an absolute URL then theprefixUrlwould end up duplicated. In order to fix this, Got now requires an absolute URL - noprefixUrlwill be applied.got.extend(…)will throw when passing some options that don't accept undefined - undefined no longer retains the old value, as setting undefined explicitly may reset the optionDocumentation
We have redesigned the documentation so it's easier to navigate and find exactly what you are looking for. We hope you like it ❤️
Note:
Configuration
📅 Schedule: "after 10pm every weekday,before 5am every weekday,every weekend" in timezone Europe/Moscow.
🚦 Automerge: Disabled due to failing status checks.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by WhiteSource Renovate. View repository job log here.